*Multilevel Regime Decoupling: The Territorial Dimension of Autocratization and Contemporary Regime Change
*ONLINE APPENDIX*
*GET V-DEM DATA FROM: https://v-dem.net/data/the-v-dem-dataset/country-year-v-dem-fullothers-v14/
*
*LOAD V-DEM DATA:
use "V-Dem-CY-Full+Others-v13.dta", clear
*
*STANDARDIZE VARIABLES OF INTEREST
*GEN POSITIVE VALUES
gen v2elffelr_pos=v2elffelr+3.459
gen v2elsnlsff_pos=v2elsnlsff+3.219
gen v2elfrfair_pos=v2elfrfair+3.373
*STD BETWEEN 0 & 1
foreach var in v2elffelr_pos v2xel_frefair v2elsnlsff_pos v2elfrfair_pos {
	qui sum `var'
	gen `var'_standard= (`var' - `r(min)') / (`r(max)'-`r(min)')
}
*CHECK
sum v2xel_frefair_standard
sum v2elffelr_pos_standard
sum v2elsnlsff_pos_standard
sum v2elfrfair_pos_standard
*
*IDENTIFY PERIOD OF INTEREST
gen period=. 
replace period=1 if year>1989 & year<2000
replace period=2 if year>1999 & year<2010 
replace period=3 if year>2009 
replace period=-99 if period==.
*CONFIRM YEARS
bys period: sum year
*ESTIMATE AVERAGE DEM SCORE PER PERIOD
gen e_polity2mod=e_polity2
replace e_polity2mod=. if e_polity2<-10
bys country_id period: egen mean_polity_period=mean(e_polity2mod)
*IDENTIFY DEMOCRATIC REGIMES PER PERIOD. 
gen dem_period_dummy=. 
replace dem_period_dummy=1 if mean_polity_period>5
replace dem_period_dummy=0 if dem_period_dummy==. 
*
keep country_id year e_regionpol v2elffelr_pos_standard v2xel_frefair_standard v2elsnlsff_pos_standard v2elfrfair_pos_standard period dem_period_dummy 
*
keep if year>1989
*
bysort country_id period (year): gen dem_nat_ave = (v2elfrfair_pos_standard + v2elfrfair_pos_standard[_n-1])/2 if year == year[_n-1] + 1
bysort country_id period (year): gen dem_subnat_ave = (v2elffelr_pos_standard + v2elffelr_pos_standard[_n-1])/2 if year == year[_n-1] + 1
*
bysort country_id period: gen first_nat_dem=dem_nat_ave if _n==2
bysort country_id period: gen second_nat_dem=dem_nat_ave if _n==_N
*
bysort country_id period: gen first_subnat_dem=dem_subnat_ave if _n==2
bysort country_id period: gen second_subnat_dem=dem_subnat_ave if _n==_N
*
bysort country_id period: egen mean_first_nat_dem=mean(first_nat_dem)
bysort country_id period: egen mean_second_nat_dem=mean(second_nat_dem)
*
bysort country_id period: egen mean_first_subnat_dem=mean(first_subnat_dem)
bysort country_id period: egen mean_second_subnat_dem=mean(second_subnat_dem)
*
*GENERATE  DIFFERENCES
gen nat_difference=mean_second_nat_dem-mean_first_nat_dem
gen subnat_difference=mean_second_subnat_dem-mean_first_subnat_dem
*
*GEN CLASSIFICATION OF QUADRANTS
gen class_difflevel=. 
replace class_difflevel=1 if nat_difference>=0  & subnat_difference>=0
replace class_difflevel=2 if nat_difference<0  & subnat_difference>=0
replace class_difflevel=3 if nat_difference<0  & subnat_difference<0
replace class_difflevel=4 if nat_difference>0  & subnat_difference<0
*
egen tag=tag(country_id period class_difflevel)
keep if tag==1
**************************************************************************************************************************************************
**************************************************************************************************************************************************
*SECTION A GRAPHS: DUPLICATE THOSE IN THE PAPER
*SECTION B GRAPHS
/*1990-2000*/
scatter subnat_difference nat_difference if period==1 & dem_period_dummy==1 /// 
,yline(0, lpat(dash) lcol(gs7)) xline(0, lpat(dash) lcol(gs7)) jitter(2) graphregion(margin(2 2 2 2)) plotregion(margin(0 0 0 0)) yscale(titlegap(0)) ysize(1) xsize(1)  ylabel(-.6(.2).8) xlabel(-.6(.2).8) subtitle("1990-2000", pos(12)) xtitle("Nat. Free & Fair {&Delta} ") ytitle("Subnat. Free & Fair {&Delta} ") msymbol(circle_hollow) mlw(vthin) mlcol(black)  msize(small) scheme(lean1) /// 
text(.7 .7 "I" .7 -.5 "II" -.5 .7 "IV" -.5 -.5 "III") /// 
text(.6 .7 "73%" .6 -.5 "22%" -.4 .7 "1%" -.4 -.5 "4%", size(small)) 
graph export fig8A_DemOnlydecoupling90s.pdf, replace
*
/*2000-2010*/
scatter subnat_difference nat_difference if period==2 & dem_period_dummy==1 /// 
,yline(0, lpat(dash) lcol(gs7)) xline(0, lpat(dash) lcol(gs7)) jitter(2)  graphregion(margin(2 2 2 2)) plotregion(margin(0 0 0 0)) yscale(titlegap(0)) ysize(1) xsize(1)  ylabel(-.6(.2).8) xlabel(-.6(.2).8) subtitle("2000-2010", pos(12)) xtitle("Nat. Free & Fair {&Delta} ") ytitle("Subnat. Free & Fair {&Delta} ") msymbol(circle_hollow) mlw(vthin) mlcol(black)  msize(small) scheme(lean1) /// 
text(.7 .7 "I" .7 -.5 "II" -.5 .7 "IV" -.5 -.5 "III") /// 
text(.6 .7 "70%" .6 -.5 "18%" -.4 .7 "3%" -.4 -.5 "9%", size(small)) 
graph export fig8B_DemOnlydecoupling00s.pdf, replace
*
/*2010-2022*/
scatter subnat_difference nat_difference if period==3 & dem_period_dummy==1  /// 
,yline(0, lpat(dash) lcol(gs7)) xline(0, lpat(dash) lcol(gs7)) jitter(2)  graphregion(margin(2 2 2 2)) plotregion(margin(0 0 0 0)) yscale(titlegap(0)) ysize(1) xsize(1)  ylabel(-.6(.2).8) xlabel(-.6(.2).8) subtitle("2010-2022", pos(12)) xtitle("Nat. Free & Fair {&Delta} ") ytitle("Subnat. Free & Fair {&Delta} ") msymbol(circle_hollow) mlw(vthin) mlcol(black)  msize(small) scheme(lean1)  /// 
text(.7 .7 "I" .7 -.5 "II" -.5 .7 "IV" -.5 -.5 "III") /// 
text(.6 .7 "26%" .6 -.5 "41%" -.4 .7 "10%" -.4 -.5 "23%", size(small)) 
graph export fig8C_DemOnlydecoupling10s.pdf, replace
*
*
*TABULATE ALL AND DEMOCRACIES ONLY
tab period class_difflevel, row
tab period class_difflevel if dem_period_dummy==1, row
*TABULATE BY REGION
tab e_regionpol class_difflevel if period==1 , row
tab e_regionpol class_difflevel if period==2 , row
tab e_regionpol class_difflevel if period==3 , row
*
tab e_regionpol class_difflevel if period==1 & dem_period_dummy==1, row
tab e_regionpol class_difflevel if period==2 & dem_period_dummy==1, row
tab e_regionpol class_difflevel if period==3 & dem_period_dummy==1, row
**************************************************************************************************************************************************
**************************************************************************************************************************************************
*ASSESS DIFFERENCES IN MEANS FOR QUADRANTS ACROSS PERIODS
*SECTION C: FOR ALL COUNTRIES
************
**NATIONAL**
************
regress nat_difference i.class_difflevel if period==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway nat_difference class_difflevel if period==1, tabulate
anova  nat_difference class_difflevel if period==1
pwmean nat_difference if period==1, over(class_difflevel) mcompare(tukey) effects

*
regress nat_difference i.class_difflevel if period==2, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal

oneway nat_difference class_difflevel if period==2, tabulate
anova  nat_difference class_difflevel if period==2
pwmean nat_difference if period==2, over(class_difflevel) mcompare(tukey) effects

*
regress nat_difference i.class_difflevel if period==3, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal

oneway nat_difference class_difflevel if period==3, tabulate
anova  nat_difference class_difflevel if period==3
pwmean nat_difference if period==3, over(class_difflevel) mcompare(tukey) effects
*
************
*SUBNATIONAL
************
regress subnat_difference i.class_difflevel if period==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway subnat_difference class_difflevel if period==1, tabulate
anova subnat_difference class_difflevel if period==1
pwmean subnat_difference if period==1, over(class_difflevel) mcompare(tukey) effects
*
regress subnat_difference i.class_difflevel if period==2, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway subnat_difference class_difflevel if period==2, tabulate
anova subnat_difference class_difflevel if period==2
pwmean subnat_difference if period==2, over(class_difflevel) mcompare(tukey) effects
*
regress subnat_difference i.class_difflevel if period==3, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway subnat_difference class_difflevel if period==3, tabulate
anova subnat_difference class_difflevel if period==3
pwmean subnat_difference if period==3, over(class_difflevel) mcompare(tukey) effects
**************************************************************************************************************************************************
**************************************************************************************************************************************************
*SECTION D: FOR DEMOCRACIES ONLY
************
**NATIONAL**
************
regress nat_difference i.class_difflevel if period==1 & dem_period_dummy==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway nat_difference class_difflevel if period==1 & dem_period_dummy==1, tabulate
anova  nat_difference class_difflevel if period==1 & dem_period_dummy==1
pwmean nat_difference if period==1 & dem_period_dummy==1, over(class_difflevel) mcompare(tukey) effects

*
regress nat_difference i.class_difflevel if period==2 & dem_period_dummy==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway nat_difference class_difflevel if period==2 & dem_period_dummy==1, tabulate
anova  nat_difference class_difflevel if period==2 & dem_period_dummy==1
pwmean nat_difference if period==2 & dem_period_dummy==1, over(class_difflevel) mcompare(tukey) effects
*
regress nat_difference i.class_difflevel if period==3 & dem_period_dummy==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway nat_difference class_difflevel if period==3 & dem_period_dummy==1, tabulate
anova  nat_difference class_difflevel if period==3 & dem_period_dummy==1
pwmean nat_difference if period==3 & dem_period_dummy==1, over(class_difflevel) mcompare(tukey) effects
*
************
*SUBNATIONAL
************
regress subnat_difference i.class_difflevel if period==1 & dem_period_dummy==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway subnat_difference class_difflevel if period==1 & dem_period_dummy==1, tabulate
anova subnat_difference class_difflevel if period==1 & dem_period_dummy==1
pwmean subnat_difference if period==1 & dem_period_dummy==1, over(class_difflevel) mcompare(tukey) effects
*
regress subnat_difference i.class_difflevel if period==2 & dem_period_dummy==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway subnat_difference class_difflevel if period==2 & dem_period_dummy==1, tabulate
anova subnat_difference class_difflevel if period==2 & dem_period_dummy==1
pwmean subnat_difference if period==2 & dem_period_dummy==1, over(class_difflevel) mcompare(tukey) effects
*
regress subnat_difference i.class_difflevel if period==3 & dem_period_dummy==1, robust cl(country_id)
testparm i.class_difflevel
testparm i.class_difflevel, equal
*
oneway subnat_difference class_difflevel if period==3 & dem_period_dummy==1, tabulate
anova subnat_difference class_difflevel if period==3 & dem_period_dummy==1
pwmean subnat_difference if period==3 & dem_period_dummy==1, over(class_difflevel) mcompare(tukey) effects
**************************************************************************************************************************************************
**************************************************************************************************************************************************
*SECTION E: EXCLUSION ZONES
*
*DELIMIT THE UPPER AND LOWER BOUNDS OF THE Y AXIS (THE HEIGHT OF THE SQUARE)
*Y_N is for the N number of exclusion zones.
*WE DO THIS PER PERIOD 
*
*PERIOD 1
sum  subnat_difference	if period==1
gen  p1_y1_high=. 
gen  p1_y1_low=.
gen  p1_y2_high=. 
gen  p1_y2_low=.
*
***VALUES ARE OBTAINED WITH ((Y_STDDEV+X_STDDEV)/2)/2----->HALF OF THE AVERAGED STD DEVIATIONS. 
*HALF OF THE AVERAGED STD DEVIATIONS==0.055
replace  p1_y1_high= 0.055	
replace  p1_y1_low= -0.055 	
replace  p1_y2_high= 0.22		
replace  p1_y2_low= -0.22
*
*NATIONAL*
*PERIOD 1
sum  nat_difference 	if period==1
gen p1_x1_high=.
gen p1_x1_low=.
gen p1_x2_high=.
gen p1_x2_low=.
*
replace p1_x1_high=  0.055	
replace p1_x1_low = -0.055	
replace p1_x2_high= 0.22		
replace p1_x2_low= -0.22
*PERIOD 2
*Subnatioanl PERIOD 2
sum  subnat_difference	if period==2
gen  p2_y1_high=. 
gen  p2_y1_low=.
gen  p2_y2_high=. 
gen  p2_y2_low=.
*
replace  p2_y1_high= 0.04204345
replace  p2_y1_low= -0.04204345 	
replace  p2_y2_high=  0.164810329		
replace  p2_y2_low=  -0.16481032
*National PERIOD 2
sum  nat_difference 	if period==2
gen  p2_x1_high=. 
gen  p2_x1_low=.
gen  p2_x2_high=. 
gen  p2_x2_low=.
*
replace p2_x1_high=  0.04204345 	
replace p2_x1_low = -0.04204345
replace p2_x2_high=  0.16481032	
replace p2_x2_low=  -0.16481032
*PERIOD 3
*SUBNATIONAL PERIOD 3
sum  subnat_difference	if period==3
gen  p3_y1_high=. 
gen  p3_y1_low=.
gen  p3_y2_high=. 
gen  p3_y2_low=.
*
replace  p3_y1_high= 0.06052398
replace  p3_y1_low= -0.06052398
replace  p3_y2_high= 0.23725398
replace  p3_y2_low= -0.23725398
*
*NATIONAL PERIOD 3
sum  nat_difference 	if period==3
gen  p3_x1_high=. 
gen  p3_x1_low=.
gen  p3_x2_high=. 
gen  p3_x2_low=.
*
replace  p3_x1_high= 0.06052398
replace  p3_x1_low= -0.06052398
replace  p3_x2_high= 0.23725398
replace  p3_x2_low= -0.23725398
*
*
*GRAPHS
*PERIOD 1
gen exclude_p1=.
replace exclude_p1=1 if period==1 & subnat_difference>=p1_y1_high
replace exclude_p1=1 if period==1 & subnat_difference<=p1_y1_low
replace exclude_p1=1 if period==1 & nat_difference<=p1_x1_low
replace exclude_p1=1 if period==1 & nat_difference>=p1_x1_high
replace exclude_p1=0 if exclude_p1==.
*
gen include_p1=.
replace include_p1=1 if period==1 & subnat_difference<=p1_y2_high & nat_difference<=p1_x2_high 
replace include_p1=0 if period==1 & nat_difference<=p1_x2_low
replace include_p1=0 if include_p1==.
*
scatter subnat_difference nat_difference if period==1, yline(0, lpat(dash) lcol(gs7)) /// 
xline(0, lpat(dash) lcol(gs7)) jitter(1) graphregion(margin(2 2 2 2)) plotregion(margin(0.3 0.3 0.3 0.3)) || /// 
rarea p1_y1_low p1_y1_high nat_difference if period==1 & nat_difference>p1_x1_low & nat_difference<p1_x1_high, sort color(navy%60) || ///
rarea p1_y2_low p1_y2_high nat_difference if period==1 & nat_difference>p1_x2_low & nat_difference<p1_x2_high, sort color(purple%20) ///
yscale(titlegap(0)) ysize(1) xsize(1) leg(pos(5) ring(0) row(2) size(small) order(2 "1/2 Avg.Std.Dev." 3 "2 Avg.Std.Dev")) /// 
subtitle("1990-2000", pos(12)) xtitle("Nat. Free & Fair {&Delta} ") ytitle("Subnat. Free & Fair {&Delta}") ///
msymbol(circle_hollow) mlw(vthin) mlcol(black)  msize(small) scheme(lean1) /// 
yscale(titlegap(0)) ylabel(-.6(.2).8) xlabel(-.6(.2).8)
*
graph export "New Figures/NEWFIG_p1ExclusionZone.pdf", replace
*
tab class_difflevel if exclude_p1==1 /*OUTSIDE BLUE ZONE*/
tab class_difflevel if include_p1==1 /*INSIDE PURPLE ZONE*/
*
*
*PERIOD 2
gen exclude_p2=.
replace exclude_p2=1 if period==2 & subnat_difference>=p2_y1_high
replace exclude_p2=1 if period==2 & subnat_difference<=p2_y1_low
replace exclude_p2=1 if period==2 & nat_difference<=p2_x1_low
replace exclude_p2=1 if period==2 & nat_difference>=p2_x1_high
replace exclude_p2=0 if exclude_p2==.
*
gen include_p2=.
replace include_p2=1 if period==2 & subnat_difference<p2_y2_high & nat_difference<p2_x2_high 
replace include_p2=0 if period==2 & nat_difference<p2_x2_low
replace include_p2=0 if period==2 & subnat_difference<p2_y2_low
replace include_p2=0 if include_p2==.
*
scatter subnat_difference nat_difference if period==2, yline(0, lpat(dash) lcol(gs7)) /// 
xline(0, lpat(dash) lcol(gs7)) jitter(1) graphregion(margin(2 2 2 2)) plotregion(margin(0.3 0.3 0.3 0.3)) || /// 
rarea p2_y1_low p2_y1_high nat_difference if period==2 & nat_difference>p2_x1_low & nat_difference<p2_x1_high, sort color(navy%60) || ///
rarea p2_y2_low p2_y2_high nat_difference if period==2 & nat_difference>p2_x2_low & nat_difference<p2_x2_high, sort color(purple%20) ///
yscale(titlegap(0)) ysize(1) xsize(1) leg(pos(5) ring(0) row(2) size(small) order(2 "1/2 Avg.Std.Dev." 3 "2 Avg.Std.Dev")) /// 
subtitle("2000-2010", pos(12)) xtitle("Nat. Free & Fair {&Delta} ") ytitle("Subnat. Free & Fair {&Delta}") ///
msymbol(circle_hollow) mlw(vthin) mlcol(black)  msize(small) scheme(lean1) /// 
yscale(titlegap(0)) ylabel(-.6(.2).8) xlabel(-.6(.2).8)
*
*
tab class_difflevel if exclude_p2==1 /*OUTSIDE BLUE ZONE*/
tab class_difflevel if include_p2==1 /*INSIDE PURPLE ZONE*/
*
*
*PERIOD 3
gen exclude_p3=.
replace exclude_p3=1 if period==3 & subnat_difference>=p3_y1_high
replace exclude_p3=1 if period==3 & subnat_difference<=p3_y1_low
replace exclude_p3=1 if period==3 & nat_difference<=p3_x1_low
replace exclude_p3=1 if period==3 & nat_difference>=p3_x1_high
replace exclude_p3=0 if exclude_p3==.
*
gen include_p3=.
replace include_p3=1 if period==3 & subnat_difference<p3_y2_high & nat_difference<p3_x2_high 
replace include_p3=0 if period==3 & nat_difference<p3_x2_low
replace include_p3=0 if period==3 & subnat_difference<p3_y2_low
replace include_p3=0 if include_p3==.
*
scatter subnat_difference nat_difference if period==3, yline(0, lpat(dash) lcol(gs7)) /// 
xline(0, lpat(dash) lcol(gs7)) jitter(1) graphregion(margin(2 2 2 2)) plotregion(margin(0.3 0.3 0.3 0.3)) || /// 
rarea p3_y1_low p3_y1_high nat_difference if period==3 & nat_difference>p3_x1_low & nat_difference<p3_x1_high, sort color(navy%60) || ///
rarea p3_y2_low p3_y2_high nat_difference if period==3 & nat_difference>p3_x2_low & nat_difference<p3_x2_high, sort color(purple%20) ///
yscale(titlegap(0)) ysize(1) xsize(1) leg(pos(5) ring(0) row(2) size(small) order(2 "1/2 Avg.Std.Dev." 3 "2 Avg.Std.Dev")) /// 
subtitle("2010-2022", pos(12)) xtitle("Nat. Free & Fair {&Delta} ") ytitle("Subnat. Free & Fair {&Delta}") ///
msymbol(circle_hollow) mlw(vthin) mlcol(black)  msize(small) scheme(lean1) /// 
yscale(titlegap(0)) ylabel(-.6(.2).8) xlabel(-.6(.2).8) 
*
*
tab class_difflevel if exclude_p3==1 /*OUTSIDE BLUE ZONE*/
tab class_difflevel if include_p3==1 /*INSIDE PURPLE ZONE*/
**************************************************************************************************************************************************
**************************************************************************************************************************************************
*SECTION F
use "DifferenceAltMeasures.dta", clear
*     
*GRPAHS FOR ISED
scatter subnatdiff_ised natdiff_vanhanen,  xline(0, lpat(shortdash) lcol(gs10)) yline(0,lpat(shortdash) lcol(gs10)) ///
scheme(lean1) colorvar(period) colordiscrete coloruseplegend /// 
plegend(order(1 "1990-2000" 2 "2000-2010" 3 "2010-2022") col(3) pos(5) ring(0) size(small)) ///
xtitle("Nat. Dem. {&Delta} Using Vanhanen", size(small)) xlab(,labsize(small)) /// 
ytitle("Subnat. Dem. {&Delta} Using ISED", size(small)) ylab(,labsize(small)) ///
jitter(1) graphregion(margin(2 2 2 2)) plotregion(margin(0.3 0.3 0.3 0.3)) /// 
yscale(titlegap(0)) ysize(1) xsize(1) ylabel(-.4(.2).4) xlabel(-.4(.2).4)
*
*GRAPH FOR FIDALGO
scatter subnatdiff_fidalgo natddiff_vdempol, xline(0, lpat(shortdash) lcol(gs10)) yline(0,lpat(shortdash) lcol(gs10)) ///
scheme(lean1) colorvar(period) colordiscrete coloruseplegend /// 
plegend(order(1 "1990-2000" 2 "2000-2010" 3 "2010-2016") col(3) pos(5) ring(0) size(small)) ///
xtitle("Nat. Dem. {&Delta} Using V-Dem Polyarchy", size(small)) xlab(,labsize(small)) /// 
ytitle("Subnat. Dem. {&Delta} Using SEDS", size(small)) ylab(,labsize(small)) ///
jitter(2) graphregion(margin(2 2 2 2)) plotregion(margin(0.3 0.3 0.3 0.3)) /// 
yscale(titlegap(0)) ysize(1) xsize(1) ylabel(-.4(.2).4) xlabel(-.4(.2).4)
*
*
*GENERATE QUADRIANT CLASSIFICATION ISED
gen class_ISED_difflevel=. 
replace class_ISED_difflevel=1 if natdiff_vanhanen>=0  & subnatdiff_ised>=0
replace class_ISED_difflevel=2 if natdiff_vanhanen<0  & subnatdiff_ised>=0
replace class_ISED_difflevel=3 if natdiff_vanhanen<0  & subnatdiff_ised<0
replace class_ISED_difflevel=4 if natdiff_vanhanen>0  & subnatdiff_ised<0
replace class_ISED_difflevel=. if subnatdiff_ised==.
*TABULATE 
tab class_ISED_difflevel period, col
*GENERATE QUADRIANT CLASSIFICATION FIDALGO
gen class_FIDALGO_difflevel=. 
replace class_FIDALGO_difflevel=1 if natddiff_vdempol>=0  & subnatdiff_fidalgo>=0
replace class_FIDALGO_difflevel=2 if natddiff_vdempol<0  & subnatdiff_fidalgo>=0
replace class_FIDALGO_difflevel=3 if natddiff_vdempol<0  & subnatdiff_fidalgo<0
replace class_FIDALGO_difflevel=4 if natddiff_vdempol>0  & subnatdiff_fidalgo<0
replace class_FIDALGO_difflevel=. if subnatdiff_fidalgo==.
*TABULATE 
tab class_FIDALGO_difflevel period, col
**************************************************************************************************************************************************
**************************************************************************************************************************************************
*SECTION G: REGRESSION RESULTS ARE GENERATED IN REPFILE1 (FIGURE 4 PANEL C)
**************************************************************************************************************************************************
